package com.leyou.item.api;

import com.leyou.item.entity.TbSpecGroup;
import com.leyou.item.entity.TbSpecParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@RequestMapping("spec")
public interface SpecificationApi {
    /**
     * 操作参数表信息
     *
     * */
    //查询
    @GetMapping("params")
    List<TbSpecParam> queryParams(
            @RequestParam(value = "gid",required = false) Long gid,
            @RequestParam(value = "cid",required = false) Long cid,
            @RequestParam(value = "searching",required = false) Boolean searching,
            @RequestParam(value = "generic",required = false) Boolean generic
    );

    /**
     * 根据分类id查询分组集合
     * @param cid
     * @return
     */
    @GetMapping("groups/{cid}")
    List<TbSpecGroup> querySepcGroupsWithParamsByCid(@PathVariable("cid") Long cid);
}
